// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.ai.states;

import zombie.ai.State;
import zombie.characters.IsoGameCharacter;

public final class ForecastBeatenPlayerState extends State {
    private static final ForecastBeatenPlayerState _instance = new ForecastBeatenPlayerState();

    public static ForecastBeatenPlayerState instance() {
        return _instance;
    }

    @Override
    public void enter(IsoGameCharacter owner) {
        owner.setIgnoreMovement(true);
        owner.setReanimateTimer(30.0F);
    }

    @Override
    public void execute(IsoGameCharacter owner) {
        if (owner.getCurrentSquare() != null) {
            owner.setReanimateTimer(owner.getReanimateTimer() - zombie.GameTime.getInstance().getMultiplier() / 1.6F);
            if (owner.getReanimateTimer() <= 0.0F) {
                owner.setReanimateTimer(0.0F);
                owner.setVariable("bKnockedDown", true);
            }
        }
    }

    @Override
    public void exit(IsoGameCharacter owner) {
        owner.setIgnoreMovement(false);
    }
}
